{__NOLAYOUT__}
<layout name="no_nav" />
<style type="text/css">
	.my-list {
		margin: 1em auto;
		width: 96%;
		overflow: hidden;
		border: #ddd solid 1px;
		border-radius: 5px;
	}
	.menu-list-inner{
		margin-right: .9em;
	}
	.my-head-content{
	    position: relative;
	    padding-top: .2em;
	}
	.my-head-name{
	    margin-top: .8em;
	}
	.my-head-type{
	    position: absolute;
        left: 0;
        right: 0;
        top: 4.5em;
	}
	.my-head-type span{
	    font-size: 80%;
	    display: inline-block;
	    background: #7b72e9;
	    color: #fff;
	    padding: 2px 10px;
        border-radius: 5px;	    
	}
</style>
<!-- TOPBAR -->
<header class="top-bar flex-row">
	<a class="row-item row-item-auto top-bar-back" href="javascript:window.history.back()">返回</a>
	<h3 class="row-item top-bar-name">订单管理</h3>
	<a class="row-item row-item-auto top-bar-menu" href="{$config.url}">主页</a>
</header>

<section class="my-list menu-list">
	<foreach name="types" item="vo" key="k">
		<a class="menu-list-item menu-list-link" href="{:U('DisShopOrder/list','type='.$k.'&sid='.$sid)}">
			<div class="menu-list-media"></div>
			<div class="menu-list-inner">
				<p class="menu-list-title">{$vo}</p>
			</div>
		</a>
	</foreach>
</section>

<include file="navBar" />

<script type="text/javascript">
	$(function() {

		$("#upload-head").on("change", function(e) {

			var f = e.target.files[0];
			if (f.type.match(/image/)) {
				if (f.size > 204800) {
					APP.alert("上传的头像不能大于200KB");
					return false;
				};
			} else {
				APP.alert("请选择图片上传");
				return false;
			};

			var xhr = new XMLHttpRequest(),
				fm = new FormData();
			fm.append("sid", 1);
			fm.append("Filedata", f);
			xhr.onreadystatechange = function(e) {
				if (xhr.readyState === 4 && xhr.status === 200) {
					var response = JSON.parse(xhr.responseText);
					$("#head").attr("src", response.extra.url)
				};
			};
			xhr.open("post", "{:U('User/face')}", true);
			xhr.send(fm);

		});

	});
</script>
